#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include <iostream>
#include "myOpenCVLIB\myheader.h"


using namespace std;  
using namespace cv; 

#define w 400
#define ATOM_WINDOW "atomWindow"

Mat atomImage,rookImage;
int angle = 0;
const int angleMax = 360;

int pointX = w/2, pointY = w/2;

int sizeX = w/4, sizeY = w/16;

int startAngle = 0, endAngle = 360;
const int startEndAngleMax = 360;

int thickness = 2, lineType = 8, shift =0;
const int tlsMax = 10;


void onChange(int, void*){
	atomImage = Mat::zeros(w,w,CV_8UC3);

	ellipse(atomImage
		,Point(pointX,pointY)
		,Size(sizeX,sizeY)
		,angle
		,startAngle
		,endAngle
		,Scalar(255,0,0)
		,thickness
		,lineType
		,shift);
	
	imshow(ATOM_WINDOW, atomImage);
}

int main(){

	atomImage = Mat::zeros(w,w,CV_8UC3);
	rookImage = Mat::zeros(w,w,CV_8UC3);

	namedWindow(ATOM_WINDOW);

	createTrackbar("Angle"		,ATOM_WINDOW	,&angle			,angleMax			,onChange);
	createTrackbar("pointX"		,ATOM_WINDOW	,&pointX		,w					,onChange);
	createTrackbar("pointY"		,ATOM_WINDOW	,&pointY		,w					,onChange);
	createTrackbar("sizeX"		,ATOM_WINDOW	,&sizeX			,w					,onChange);
	createTrackbar("sizeY"		,ATOM_WINDOW	,&sizeY			,w					,onChange);
	createTrackbar("startAngle"	,ATOM_WINDOW	,&startAngle	,startEndAngleMax	,onChange);
	createTrackbar("endtAngle"	,ATOM_WINDOW	,&endAngle		,startEndAngleMax	,onChange);
	createTrackbar("thickness"	,ATOM_WINDOW	,&thickness		,tlsMax				,onChange);
	createTrackbar("lineType"	,ATOM_WINDOW	,&lineType		,tlsMax				,onChange);
	createTrackbar("shift"		,ATOM_WINDOW	,&shift			,tlsMax				,onChange);
	

	waitKey(0);
	return 0;
}




